package com.yd.sdk.pay;

import android.app.Activity;
import android.os.Bundle;

import com.unity3d.player.UnityPlayer;
import com.yd.sdk.IUnityActivityLifecycleEvents;

public abstract class PayAbstractClass implements IPay,IPayListener, IUnityActivityLifecycleEvents {

    protected Activity activity;
    private static final String GAMEOBJECT = "SDKManagers/PayManager";

    @Override
    public void OnIAPServerDisconnected() {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnIAPServerDisconnected","");
    }

    @Override
    public void OnIAPSetUpSuccess() {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnIAPSetUpSuccess","");
    }

    @Override
    public void OnIAPSetUpFailed(String message) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnIAPSetUpFailed",message);
    }

    @Override
    public void OnIAPPurchaseSuccess(String message) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnIAPPurchaseSuccess",message);
    }

    @Override
    public void OnIAPPurchaseFailed(String name, String message) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnIAPPurchaseFailed",name+":"+message);
    }

    @Override
    public void OnQueryPurchaseHistorySucess(String skus) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnQueryPurchaseHistorySucess",skus);
    }

    @Override
    public void OnQueryPurchaseHistoryFailed(String message) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnQueryPurchaseHistoryFailed",message);
    }
}
